#include "CommonObject.h"

unsigned int CommonObject::s_objCount = 0;
unsigned int CommonObject::ObjectCount()
{
	return s_objCount;
}


CommonObject::CommonObject(bool bShow)
	: m_bShow(bShow)
{
	s_objCount++;
}


CommonObject::~CommonObject(void)
{
	s_objCount--;
}


void CommonObject::Show()
{
	m_bShow = true;
}


void CommonObject::Hide()
{
	m_bShow = false;
}

float CommonObject::GetDistance(Point3f point)
{
	float deltaX = m_origin.x - point.x;
	float deltaY = m_origin.y - point.y;
	float deltaZ = m_origin.z - point.z;

	return deltaX*deltaX + deltaY*deltaY* + deltaZ*deltaZ;
}